package com.fss.util;

import java.util.Map;  
  
import com.opensymphony.xwork2.Action;  
import com.opensymphony.xwork2.ActionContext;  
import com.opensymphony.xwork2.ActionInvocation;  
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.fss.util.Constants;  

import com.fssDataModels.TbUser;
  
@SuppressWarnings("serial")
public class AuthorIterceptor extends AbstractInterceptor {


	@Override  
    public String intercept(ActionInvocation actionInvocation) throws Exception {  
		ActionContext ctx = ActionContext.getContext();  
        Map session = ctx.getSession();  
        Action action = (Action) actionInvocation.getAction();
        
        TbUser User_temp = (TbUser)session.get(Constants.USER_LOGIN);

        	if(User_temp == null){
        		return Action.ERROR;
        	}
        return actionInvocation.invoke();
    }
	
	
  
}  